package StringBuilder_study;

public class StringBuilder_study {
    public static void main(String[] args) {
        StringBuilder bu1 = new StringBuilder();
        System.out.println(bu1);
        //打印为空，因为没有给bu1中赋予字符串
        System.out.println("========================");
        StringBuilder bu2 = new StringBuilder("abc");
        System.out.println(bu2);
        //打印abc
        System.out.println("========================"  );
        StringBuilder bu3 = new StringBuilder();
        StringBuilder bu4 = bu3.append("我爱你");
        //在bu3中添加字符串并返回到原来的字符串中
        System.out.println(bu3+"<>"+bu4);
        System.out.println(bu3==bu4);
        //返回为true说明地址是一样的
        //所以使用append方法无需设置返回值
        System.out.println("========================"  );
        bu4.reverse();
        System.out.println(bu4);
        //反转字符串中的内容
    }
}
